package com.tjbank.cssys.mybatis.impl;


import com.tjbank.cssys.mybatis.IamLogDao;
import com.tjbank.cssys.mybatis.entity.IamLog;
import com.tjbank.cssys.mybatis.entity.IamLogKey;
import com.tjbank.cssys.mybatis.mapper.IamLogMapper;
import com.tjbank.cssys.mybatis.sqlbuilder.IamLogSqlBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class IamLogDaoImpl implements IamLogDao {
    @Resource
    private IamLogMapper iamLogMapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
    public int insert(IamLog iamLog) throws RuntimeException {
        return iamLogMapper.addInsert(iamLog);
    }




    @Override
    public List<IamLog> selectListBySqlBuilder(IamLogSqlBuilder iamLogSqlBuilder) throws RuntimeException {
        return iamLogMapper.selectBySqlBuilder(iamLogSqlBuilder);
    }

    @Override
    public int insertUseBatch(List<IamLog> listIamLogs) throws RuntimeException {
        return iamLogMapper.insertUseBatch(listIamLogs);
    }

    @Override
    public int updateByPrimaryKey(IamLog iamLog) throws RuntimeException {
        return iamLogMapper.updateByPrimaryKey(iamLog);
    }

    @Override
    public int updateByPrimaryKeySelective(IamLog iamLog) throws RuntimeException {
        return iamLogMapper.updateByPrimaryKeySelective(iamLog);
    }

    @Override
    public int deleteBySqlBuilder(IamLogSqlBuilder iamLogSqlBuilder) throws RuntimeException {
        return iamLogMapper.deleteBySqlBuilder(iamLogSqlBuilder);
    }

    @Override
    public int deleteByPrimaryKey(IamLogKey iamLogKey) throws RuntimeException {
        return iamLogMapper.deleteByPrimaryKey(iamLogKey);
    }
}
